<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\facade\Route;
use app\middleware\backend\AuthMiddleware as BAuthMiddleware;

/**
 * 客服路由组
 * 暂废弃
 */

/**
 * 域名组
 */
// Route::domain(config('domain.backend'), function () {
Route::group('', function () {

    /**
     * 无权限验证
     */
    Route::group('', function () {

        /*
         * 网站
         */
        Route::rule('site/view', 'backend.site.SiteController/view');
        Route::rule('site/login', 'backend.site.SiteController/login');
        Route::rule('site/logout', 'backend.site.SiteController/logout');

        /*
         * 测试
         */
        Route::rule('test/:action', 'backend.TestController/:action');
    });

    /**
     * 存在验证
     */
    Route::group('', function () {

        /*
         * 系统管理
         */
        // 员工
        Route::rule('admin/:action', 'backend.system.AdminController/:action');

    })->pattern(['id' => '\d+', 'ids' => '[1-9]\d*(,[1-9]\d*)*'])->middleware([
        BAuthMiddleware::class,
    ]);
})->middleware([
    'cors'
]);

